using UnityEngine;
using QFramework;
using UnityEngine.SceneManagement;

namespace ProjectIndieFarm
{
    public partial class GameStartPanel : ViewController
    {
        private void Start()
        {
            BtnNewGame.onClick.AddListener(BtnNewGame_OnClick);
            BtnStartGame.onClick.AddListener(BtnStartGame_OnClick);
            BtnExitGame.onClick.AddListener(BtnExitGame_OnClick);
        }
        private void OnDestroy()
        {
            BtnNewGame.onClick.RemoveAllListeners();
            BtnStartGame.onClick.RemoveAllListeners();
            BtnExitGame.onClick.RemoveAllListeners();
        }
        #region btn onclick
        private void BtnNewGame_OnClick()
        {
            Global.ResetGameData();
            SceneManager.LoadScene("Game");
        }
        private void BtnStartGame_OnClick()
        {
            SceneManager.LoadScene("Game");
        }
        private void BtnExitGame_OnClick()
        {
            Application.Quit();
        }
        #endregion
    }
}
